package com.example.test_1;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class demoCommonAttrActivity extends AppCompatActivity {

    private TextView XXX;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_demo_common_attr);
        /** 通过findViewById 去初始化 private TextView XXX;控件  */
        XXX = findViewById(R.id.XXX);

        /**点击事件 onclick listener*/
        XXX.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(demoCommonAttrActivity.this, "点击事件成功！！！", Toast.LENGTH_SHORT).show();
            }
        });
    }
}